package com.city.service.city.impl;

import com.city.domain.city.CityTown;
import com.city.repository.city.CityTownRepository;
import com.city.service.city.CityTownService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @deprecation: 乡镇基本信息表
 * @dmail: 398521613@qq.com
 * @author: L-H
 * @date: 2018-07-18 13:14
 */
@Service
public class CityTownServiceImpl implements CityTownService {
    @Autowired
    private CityTownRepository townRepository;

    @Override
    public List<CityTown> findName(String code) {
        return townRepository.findName();
    }

    /**
     * @Author: 李顺时
     * @Description: 获取对应乡镇的名称
     * @param: id 乡镇的id
     * @Date: 16:39 2018/8/12
     */
    @Override
    public String findTownNameByCode(Integer id) {
        return townRepository.findTownNameById(id);
    }
}
